package com.jt.redis;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;

/**
 * Collection
 * 1)List
 * 2)Set
 * 3)Queue
 * Map
 */
public class BlockingQueueDemo01 {
    public static void main(String[] args) throws InterruptedException {
        BlockingQueue<Integer> queue=
                new ArrayBlockingQueue<>(2);
        queue.put(100);
        queue.put(200);
        System.out.println(queue);//100,200
        //queue.put(300);
        Integer a = queue.take();
        System.out.println(a);
        Integer b = queue.take();
        System.out.println(b);
        //queue.take();

    }
}
